﻿using BaseGrpcServer.Services;

namespace BaseGrpcServer.Extensions
{
    public static class GrpcServicesExtensions
    {
        public static IEndpointRouteBuilder MapAllGrpcServices(this IEndpointRouteBuilder builder)
        {
            builder.MapGet("/", () => "Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909");
            /*所有GRPC服务都可以集中这里映射*/
            builder.MapGrpcService<GreeterService>();
            builder.MapGrpcService<UserService>();
            return builder;
        }
    }
}
